package com.dcd.controller;

import com.dcd.pojo.Car_model;
import com.dcd.pojo.Car_model_images;
import com.dcd.pojo.Car_model_images_type;
import com.dcd.pojo.Specific_color;
import com.dcd.service.Car_model_ImagesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin
@RequestMapping("/car_model_ImagesController")
public class Car_model_ImagesController {

    @Autowired
    private Car_model_ImagesService cis;

    /**
     *  查询所有大图类型名称
     * @return
     */
    @RequestMapping("/select_car_model_imgType")
    public List<Car_model_images_type> select_car_model_imgType(){
         return cis.select_car_model_imgType();
    }

    /**
     * 根据条件查询相关实拍大图 相关车系
     * @param car_model_images_type_id  //外观，内饰等id
     * @param brand_id     //品牌id
     * @param car_series_id   //车系id
     * @param car_model_id   //车型id
     * @param specific_color_id   //颜色id
     * @return
     */
    @RequestMapping(
    "/select_car_model_imgById/{brand_id}/{car_series_id}/{car_model_id}/{car_model_images_type_id}/{specific_color_id}"
    )
    public List<Car_model> select_car_model_imgById(
            @PathVariable int brand_id,
            @PathVariable int car_series_id,
            @PathVariable int car_model_id,
            @PathVariable int car_model_images_type_id,
            @PathVariable int specific_color_id){
        return cis.select_car_model_imgById(brand_id,car_series_id,car_model_id,car_model_images_type_id,specific_color_id);
    }

    /**
     * 查询所有颜色
     * @return
     */
    @RequestMapping("/select_specific_color/{car_model_images_type_id}/{car_model_id}")
    public List<Car_model_images> select_specific_color(@PathVariable int car_model_images_type_id,@PathVariable int car_model_id){
        return cis.select_specific_color(car_model_images_type_id,car_model_id);
    }
    
}
